# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-parse-registry
_pkgname="Parse-Win32Registry"
pkgver=1.1
pkgrel=3
pkgdesc='Module for parsing Windows Registry files.'
arch=('any')
url="https://metacpan.org/pod/Parse::Win32Registry"
license=('GPL' 'PerlArtistic')
depends=(perl)
options=('!emptydirs' purge)
source=("https://cpan.metacpan.org/authors/id/J/JM/JMACFARLA/$_pkgname-$pkgver.tar.gz")
sha512sums=('6b85ffbe971a7908a8fdddc59873097f01faa508ff8af88ce15c603baecb44de28813ee9a5d43c70d40f488a2f7aafbce22f644b6e3924712c94e46420e70bd6')


build() {
  cd "$_pkgname-$pkgver"

  unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

  /usr/bin/perl Makefile.PL
  make
}

package() {
  cd "$_pkgname-$pkgver"

  unset INSTALLDIRS DESTDIR PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT

  make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}

